<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>split</title>
</head>
<body>
<script>
    function splitStr(str,type){
        var array=str.split(type);
        return array;
    };
    console.log(splitStr("123、456、789、123","、"));
    console.log(splitStr("123/456/789/123","/"));
</script>
</body>
</html>